import {
  ajax
} from "@/config/apiServer/axios-config.js";
import {
  URLS
} from "@/config/apiServer/urls.js";

// 获取平行链列表
export function getParaList(form) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.WALLET_PARALLEL_LIST,
    params: form
  })
}

// 创建平行链
export function createParaList(form) {
  return ajax({
    type: 'post',
    typeData: true,
    url: URLS.WALLET_PARALLEL,
    params: form
  })
}

// 更新平行链
export function updateParaList(form) {
  return ajax({
    type: 'put',
    typeData: true,
    url: URLS.WALLET_PARALLEL,
    params: form
  })
}

// 删除平行链
export function delParaList(id) {
  return ajax({
    type: 'delete',
    typeData: true,
    url: URLS.WALLET_PARALLEL,
    params: id
  })
}

// 钱包列表
export function getWallets(params) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.WALLET_LISTS,
    params: params
  })
}

// 创建钱包
export function createWallet(params) {
  return ajax({
    type: 'post',
    typeData: true,
    url: URLS.WALLET_OPERATE,
    params: params
  })
}

// 更新钱包
export function updateWallet(params) {
  return ajax({
    type: 'put',
    typeData: true,
    url: URLS.WALLET_OPERATE,
    params: params
  })

}

// 删除钱包
export function delWallet(id) {
  return ajax({
    type: 'delete',
    typeData: true,
    url: URLS.WALLET_OPERATE,
    params: id
  })
}

// 支持的法币
export function supLegalCoin() {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.WALLET_LEGALLIST
  })
}


// 支持的货币列表
export function supLegalCoins(params) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.WALLET_LEGALCOIN,
    params: params
  })
}

// 添加计价货币
export function addLegalCoin(params) {
  return ajax({
    type: 'post',
    typeData: true,
    url: URLS.WALLET_LEGALCOIN_OPERATE,
    params: params
  })
}

// 删除计价货币
export function delLegalCoin(id) {
  return ajax({
    type: 'delete',
    typeData: true,
    url: URLS.WALLET_LEGALCOIN_OPERATE,
    params: id
  })
}

// 更新计价货币
export function updateLegalCoin(params) {
  return ajax({
    type: 'put',
    typeData: true,
    url: URLS.WALLET_LEGALCOIN_OPERATE,
    params: params
  })
}

// 支持链列表
export function getSupParallel(params) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.PARALLEL_SUPPORTED,
    params: params
  })
}

// 添加支持链
export function addSupParallel(params) {
  return ajax({
    type: 'post',
    typeData: true,
    url: URLS.PARALLEL_SUPPORTED_OPERATE,
    params: params
  })
}

// 删除支持链
export function delSupParallel(params) {
  return ajax({
    type: 'delete',
    typeData: true,
    url: URLS.PARALLEL_SUPPORTED_OPERATE,
    params: params
  })
}